package com.pan.base;

import java.awt.*;

/**
 * 用来管理java.awt.Robot的工具类
 */
public enum RobotUtil {
    INSTANCE;
    private Robot robot;
    {
        try {
            robot = new Robot();
        } catch (AWTException e) {
            throw new RuntimeException(e);
        }
    }

    public Robot provideRobot(){
        return robot;
    }

    public Robot provideNewRobot(){
        try {
            Robot r = new Robot();
            return  r;
        } catch (AWTException e) {
            throw new RuntimeException(e);
        }
    }
}
